﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
	xmlns:xx="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
	xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <!--TabControl Right Bottom Syle-->
    <Style x:Key="SwitchRightBottomStyle"	TargetType="sdk:TabControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sdk:TabControl">
                    <Grid>
                        <Grid x:Name="TemplateRight">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <xx:TabPanel x:Name="TabPanelRight" Grid.Column="1" Canvas.ZIndex="1" VerticalAlignment="Bottom" Margin="0,0,0,150" />
                            <ContentPresenter x:Name="ContentRight" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SwitchTabItemRightTemplate" TargetType="sdk:TabItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="#FFB4B4B4"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="Padding" Value="6" />
        <Setter Property="Width" Value="40" />
        <Setter Property="Height" Value="50" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sdk:TabItem">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1"/>
                                    <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.3"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="TabRightUnSelected" 
                                            Storyboard.TargetProperty="Opacity" 
											                      From="0.25"
                                            To="1"
                                            Duration="0:0:0.3"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <!-- TabStripPlacement Right | Selected -->
                        <Grid x:Name="TemplateRightSelected" Visibility="Collapsed" Canvas.ZIndex="1">
                            <Border x:Name="TabRightSelected" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0,2" Opacity="1">
                                <Grid>
                                    <Line X1="0" X2="0" Y1="0" Y2="4000" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" HorizontalAlignment="Right"/>
                                    <Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Top"/>
                                    <Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Bottom"/>
                                    <ContentControl x:Name="HeaderRightSelected" IsTabStop="False" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
                                </Grid>
                            </Border>
                        </Grid>

                        <!-- TabStripPlacement Right | Unselected -->
                        <Grid x:Name="TemplateRightUnselected" Visibility="Collapsed">
                            <Border x:Name="TabRightUnSelected" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0,2" Opacity="0.3">
                                <Grid>
                                    <Line X1="0" X2="0" Y1="0" Y2="4000" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" HorizontalAlignment="Right"/>
                                    <Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Top"/>
                                    <Line X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Bottom"/>
                                    <ContentControl x:Name="HeaderRightUnselected" IsTabStop="False" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" />
                                </Grid>
                            </Border>
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>
